#pragma once

#include "SmallMediaPlayer.h"
#include "VideoRenderer.h"
#include <memory>

using namespace std;


namespace SmallMediaLibrary {

	public ref class VideoPlayer : public MediaPlayer
	{
	public:
		VideoPlayer();
		~VideoPlayer();

		//overridden members...
		virtual void Load(String^ filename) override;

	protected:
		void AddVideoRenderer();
		VideoMemoryRenderer* mMemoryRenderer;
	
	public:
		void SetReceivingFrame(VideoFrame^ frame);
		void OverrideSourceRegion(Region^ rect);

		delegate void FrameReady(void);
		event FrameReady^ FrameReadyEvent;
		void OnFrameReady()
		{
			FrameReadyEvent();
		}
	
	protected:
		VideoFrame^ defaultFrame;	//(dont worry its not meant to be initalised anywhere)
	};
}
